package cc.vicp.djx314.starfood.web.activity;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cc.vicp.djx314.starfood.domain.dish.Activity;
import cc.vicp.djx314.starfood.service.activity.CustomerActivityService;

@Controller
public class ActivityInfoController {
	//~属性=====================================================================
	@Autowired
	private CustomerActivityService customerActivityService;

	//~方法=====================================================================
	@RequestMapping(value = "/activity/{id}" ,method = RequestMethod.GET)
	public String activityInfo(Model model, @PathVariable("id") Integer id) {
		Activity activity = customerActivityService.getActivityInfo(id);
		model.addAttribute("activity", activity);
		return "customer/infoshow/activityInfo";
	}

	//~getter和setter=====================================================================
	public void setCustomerActivityService(
			CustomerActivityService customerActivityService) {
		this.customerActivityService = customerActivityService;
	}
}
